package com.visualize.demo.repository;

import com.visualize.demo.model.ThreeEmotion;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import java.util.Date;
import java.util.List;

public interface ThreeEmotionRepository extends CrudRepository<ThreeEmotion, Integer> {
    @Query(value = "select id,good,bad,medium,time " +
            "from three_emotion " +
            "where time between :start_time and :end_time", nativeQuery = true)
    List<ThreeEmotion> getThreeEmotionsByTime(@Param("start_time") Date start_time, @Param("end_time") Date end_time);
}
